package apiday02.object;

import java.util.Arrays;

public class ToStringDemo2 {
	public static void main(String[] args) {
		Airplane[] planes = {
				new Airplane(1, 1, 40, 50),
				new Airplane(2, 3, 40, 50),
				new Airplane(30, 20, 40, 50)
		};
		//                        join()
		System.out.println(Arrays.toString(planes));
	}
}
class Airplane{
	int x, y, w, h;
	public Airplane(int x, int y, int w, int h) {
		this.x = x;
		this.y = y;
		this.w = w;
		this.h = h;
	}
	@Override
	public String toString() {
		return "[" + x + "-" + y + "-" + w + "-" + h + "]";
	}

}
